//
//  ImageButton.m
//  NPS
//
//  Created by jadd on 15/12/11.
//  Copyright © 2015年 jadd. All rights reserved.
//

#import "ImageButton.h"

@implementation ImageButton

- (void) setImage:(UIImage *)image withTitle:(NSString *)title forState:(UIControlState)stateType {
    //UIEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right)
    
    //CGSize titleSize = [title sizeWithFont];
    //[self.imageView setContentMode:UIViewContentModeCenter];
    [self setImageEdgeInsets:UIEdgeInsetsMake(0.0,
                                              160.0,
                                              0.0,
                                              0.0)];
    [self setImage:image forState:stateType];
    
    [self.titleLabel setContentMode:UIViewContentModeCenter];
    //[self.titleLabel setBackgroundColor:[UIColor clearColor]];
    //[self.titleLabel setFont:HELVETICANEUEMEDIUM_FONT(12.0f)];
    //[self.titleLabel setTextColor:RED];
    [self setTitleEdgeInsets:UIEdgeInsetsMake(0.0,
                                              -20.0,
                                              0.0,
                                              0.0)];
    [self setTitle:title forState:stateType];
}

@end
